\section{Errorcodes}
\label{fehlercodes}

Errorcodes are returned from every function in the system. If an error occured, the function aborts right away.

\paragraph{FTL001\_NO\_ERROR}
No error occured.

\paragraph{FTL001\_HANDLER\_ERROR}
An invalid handler is specified.

\paragraph{FTL001\_CFI\_QUERYID\_ERROR}
An error occured during the query for the CFI-data. The byte sequence 'QRY' was not recognized. Either an invalid flash-chip is addressed or the low-level RDID-function isnt correct.

\paragraph{FTL001\_WRITE\_ENABLE\_ERROR}
The write-enable flag wasn't read out correctly after writing it into the register. Either the low-level-function for writing or reading the flag isn't correct.

\paragraph{FTL001\_ERASE\_SECTOR\_ERROR}
An error occured during the erase of a sector. A timeout triggers this error. Perhaps the low-level function for erasing the sector isnt't correct.

\paragraph{FTL001\_SECTOR\_INVALID\_NOTE}
This error code is just a notification and is returned during the initialization. This error doesn't abort the function. This notification is returned, if erasing a sector during the initialization leads to an error. This sector will be marked as not guilty and wouldn't be used further.

\paragraph{FTL001\_LOGICAL\_ADDRESS\_ERROR}
The specified logical address isn't situated within the range of the logical address space. Either an invalid logical address was committed or reading or writing went beyond the address space.

\paragraph{FTL001\_PHYSICAL\_ADDRESS\_ERROR}
The calculated physical address isn't situated within the range of the phyical address space of the flash memory. There is maybe an error in the address translation tables. A reset of the system and therefor a rebuild of the translation tables is a possbile solution.

\paragraph{FTL001\_NO\_FREE\_SECTOR}
There is no free sector available. Even consolidation operations can't create more free space. A larger flash-chip should be considered. This error sometimes occur after wrong SPI-settings. Pleasy verify them.

\paragraph{FTL001\_GET\_STATUS\_ERROR}
An error occured during the reading of the status. The status table wasn't created yet. This function must be called after the initialization.

\paragraph{Other errors}
The following points should be checked if the emulation is not working as it is expected.

\begin{itemize}
	\item array of transmitted or received data must be uint16\_t
	\item hybrid\_ftl.h and header of memory-specific library must be included
	\item local handler declared and functions must be assigned
	\item local handler registered
	\item emulation initialized
	\item correct length of the array handed over to the function
\end{itemize}